# coding=utf-8

from PyQt5 import QtCore,QtGui,QtWidgets,QtWebEngineWidgets

# class WebEngineView(QtWebEngineWidgets.QWebEngineView):
#     def createWindow(self,QWebEnginePage_WebWindowType):
#         page = WebEngineView(self)
#         page.urlChanged.connect(self.on_url_changed)
#         return page
#     def on_url_changed(self,url):
#         self.setUrl(url)


if __name__ == "__main__":
    import sys
    app = QtWidgets.QApplication(sys.argv)
    window = QtWidgets.QMainWindow()
    window.resize(QtCore.QSize(1000, 600))
    # webbrowser = WebEngineView()
    webbrowser = QtWebEngineWidgets.QWebEngineView()
    webbrowser.load(QtCore.QUrl("https://www.baidu.com"))
    window.setCentralWidget(webbrowser)
    window.show()
    sys.exit(app.exec_())
